package com.sz.biz.logistics.base.service.impl;

import com.sz.biz.logistics.base.entity.ShippingLineSettingDetail;
import com.sz.biz.logistics.base.service.ShippingLineSettingDetailService;
import com.sz.biz.logistics.base.dto.ShippingLineSettingDetailDto;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Function: ShippingLineSettingDetailService <br>
 * Author: wentao.chang <br>
 * Date: 2017-08-21 15:47:00
 */
@Service("shippingLineSettingDetailService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ShippingLineSettingDetailServiceImpl extends AbstractService implements ShippingLineSettingDetailService {
    @Override
    public void save(List<ShippingLineSettingDetailDto> shippingLineSettingDetailDto) {
        dao.batchInsert("ShippingLineSettingDetailMapper.insert",shippingLineSettingDetailDto);
    }

    /**
     * 根据shippingLineSettingId删除明细
     *
     * @param shippingLineSettingId shippingLineSettingId
     */
    @Override
    public void deleteByShippingLineSettingId(Integer shippingLineSettingId) {
        dao.delete("ShippingLineSettingDetailMapper.deleteByShippingLineSettingId",shippingLineSettingId);
    }

    /**
     * 根据id查询航班信息
     *
     * @param shippingLineSettingId shippingLineSettingId
     * @return ShippingLineDto
     */
    @Override
    public List<ShippingLineSettingDetail> findByShippingLineSettingId(Integer shippingLineSettingId) {
        return dao.findForList("ShippingLineSettingDetailMapper.selectByShippingLineSettingId",shippingLineSettingId,ShippingLineSettingDetail.class) ;
    }
}
